package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.ClassSettlement;
import com.shensi.api.admin.domian.station.dto.AutomaticClassDto;
import com.shensi.api.admin.domian.station.dto.ClassSettlementDto;
import com.shensi.api.admin.domian.station.dto.ReportSettlementDto;
import com.shensi.api.admin.domian.station.dto.StationClassTimeDto;
import com.shensi.api.admin.domian.station.dto.StationDto;
import com.shensi.api.admin.domian.station.vo.ClassSettlementVo;
import com.shensi.api.admin.domian.station.vo.ReportSettlementVo;
import com.shensi.api.admin.domian.station.vo.StationClassTimeVo;
import com.shensi.api.admin.domian.station.vo.StationVo;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.SHENSI_ADMIN_COLLECT,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface ClassSettlementClient {

    /**
     * 查询未班结列表
     */
    @GetMapping("/station/classSettlement/initiateClassSe")
    public AjaxResult initiateClassSe(ClassSettlementDto classSettlement);


    /**
     * 班级批量删除
     *
     * @param classNo 班结结算ID数组
     * @return AjaxResult
     */
    @DeleteMapping("/station/classSettlement/delete")
    public AjaxResult delete(@RequestBody String[] classNo) ;


    /**
     * 查询班结列表
     */
    @GetMapping("/station/classSettlement/list")
    public TableDataInfo list(ClassSettlementDto classSettlement);


    @GetMapping("/station/classSettlement/exportClassReport")
    public AjaxResult exportClassReport(ClassSettlementDto classSettlement);

    /**
     * 查询班结列表
     */
    @GetMapping("/station/classSettlement/classReportList")
    public TableDataInfo classReportList(ClassSettlementDto classSettlement);


    @PostMapping("/station/classSettlement/updateClassTime")
    public ResponseEntity<String> updateShiftTime(@RequestBody StationClassTimeDto timeDto);

    @GetMapping("/station/classSettlement/getDayClassTime")
    public StationClassTimeVo getDayShiftTimeByStationId();

    /**
     * 查询班结汇总
     */
    @GetMapping("/station/classSettlement/classSettlementSum")
    public ClassSettlementVo classSettlementSum(ClassSettlementDto classSettlement);


    /**
     * 查询班结汇总
     */
    @GetMapping("/station/classSettlement/classReportSum")
    public ReportSettlementVo classReportSum(ClassSettlementDto classSettlement);

    @GetMapping("/station/classSettlement/export")
    public AjaxResult export(ClassSettlementDto classSettlement);

    /**
     * 获取班结详细信息
     */
    @GetMapping(path = {"/station/classSettlement/{classNo}"})
    public AjaxResult getInfo(@PathVariable("classNo") String classNo);


    /**
     * 获取班结详细信息
     */
    @GetMapping(value = "/station/classSettlement/getReport")
    @ApiOperation("报表详情")
    public AjaxResult getReport(ReportSettlementDto reportSettlement);

    /**
     * 获取班结详细信息
     * 为了暴露接口给双屏机调用
     */
    @GetMapping(value = "/station/classSettlement/dualScreen/{classNo}")
    public AjaxResult getOutInfo(@PathVariable("classNo") String classNo);

    /**
     * 班结
     */
    @GetMapping("/station/classSettlement/stationCreateClassSe")
    public AjaxResult stationCreateClassSe(ClassSettlementDto classSettlement) ;

    /**
     * 确认班结
     */
    @GetMapping(path = {"/station/classSettlement/createClassSe"})
    public AjaxResult createClassSe(ClassSettlement classSettlement) throws InterruptedException;


    /**
     * 班结
     */
    @GetMapping("/station/classSettlement/exportClassSe")
    public AjaxResult exportClassSe(ClassSettlementDto classSettlement);


    @PostMapping("/station/classSettlement/setAutomaticClass")
    public AjaxResult setAutomaticClass(@RequestBody AutomaticClassDto classDto);

    @GetMapping("/station/classSettlement/getAutomaticClass")
    public AjaxResult getAutomaticClass(Long id);

    @GetMapping("/station/classSettlement/getEnterpriseStationList")
    public List<StationVo> getEnterpriseStationList(StationDto station);

    @GetMapping(path = {"/station/classSettlement/lastTimeByUserIdBGApi"})
    public AjaxResult lastTimeByUserIdBGApi(Long userId) throws InterruptedException;

    @GetMapping(path = {"/station/classSettlement/isStaffBGApi"})
    public AjaxResult isStaffBGApi(Long userId) throws InterruptedException;

    /**
     * 获取班结打印
     */
    @PostMapping("/station/classSettlement/anony/getPOSClassSettlementInfo")
    public AjaxResult getPOSClassSettlementInfo(@RequestBody ClassSettlement classSettlement);

    /**
     * 获取班结打印
     */
    @PostMapping("/station/classSettlement/anony/getClassSettlementPrintInfo")
    public AjaxResult getClassSettlementPrintInfo(@RequestBody ClassSettlement classSettlement);

}
